#!/usr/bin/env python
# encoding: utf-8
'''
@author: 王震
@license: 四川凡狼科技有限公司
@contact: 2668985108@qq.com
@file: note.py
@time: 2021/10/2 2:58 下午
@desc:
'''

from flask import Blueprint, request
from app.business.note.note import add_note as add, get_note_details as get
from app.public.sqlMethods import auto

note = Blueprint('note', __name__, url_prefix='/api')


@note.route('/add/note', methods=['POST'])
@auto.login_required
def add_note():
    data = request.json
    return add(data=data)


@note.route('/get/note/details', methods=['GET'])
@auto.login_required
def get_note_details():
    _id = request.args.get('parentId')
    return get(_id=_id)
